home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / p2c.zip / P2C.DOC < prev    next >
Text File  |  1987-03-27  |  2KB  |  56 lines

  1. NAME
  2.     p2c    - Pascal to C translator
  3.  
  4. SYNOPSIS
  5.     p2c < foo.pas > foo.c
  6.  
  7. DESCRIPTION
  8.     p2c converts many Pascal structures to their C equivalent.
  9.     The Pascal source can be in upper, lower, or mixed case; case is
  10.     preserved during translation.
  11.  
  12.     Structures translated properly include simple assignment
  13.     and comparison statments, variable, type, and label declarations, 
  14.     enumerated types, and procedure and function declarations and instances.
  15.  
  16.     Structures NOT translated properly include sets, constant declarations,
  17.     variant records, files, subrange types, VAR parameters, CASE, FOR, 
  18.     WITH, READ, and WRITE statements, and nested procedures.
  19.  
  20.     The translator provides hints about untranslated regions by inserting
  21.     UPPERCASE messages enclosed with /* and */ into the translated source.
  22.     Error messages are of the form /***# Expected ... ***/.
  23.  
  24.     Human massaging of the output will certainly be needed.
  25.     In fact, you may want to modify the keyword translation table
  26.     to better translate your particular variant of Pascal.
  27.  
  28. IMPLEMENTATION
  29.     Written in C for Sun UNIX workstations; ought to compile on other 
  30.     systems without change...
  31.     Some of the translation is done with a keyword table, but most of
  32.     the work is done by a recursive-descent parser.
  33.  
  34. BUGS
  35.     Not well tested.
  36.     Error recovery is very poor- the first error in translation inside
  37.     the recursive-descent section will result in a very long stream of
  38.     error messages.
  39.     Some of the bread-and-butter structures of Pascal- like CASE and FOR-
  40.     are not translated properly, although it would be easy to extend
  41.     the parser to understand them.
  42.  
  43.     I welcome bug reports, and invite anyone interested to implement
  44.     more PASCAL structures; I probably won't work on it much, because
  45.     I don't use Pascal these days.
  46.  
  47. VERSION
  48.     This version by Daniel Kegel <dan@srs.UUCP> or <seismo!rochester!srs!dan>,
  49.     25 March 87.
  50.     Based on a program by James A Mullens  <jcm@ornl-msr.arpa>  29-Jan-87
  51.     which was in turn based on two nearly identical programs by Robert Heller  
  52.     (1 Feb 1985) and Rick Walker <walker@hpl-opus.hp.COM> (8 Sep 1986)
  53.     which were reportedly derived from a similar program in the Feb 85 Byte
  54.     which did a C TO PASCAL conversion.
  55.  
  56.